<script lang='ts' setup name='DepartmentList'>  
 import { ref } from 'vue' 


 /**
  *  private Integer id;
    private String name;
    private String address;
    private String leader;


    private Integer active;
    //cTime  create_time  uTime  update_time
    @TableField(value = "createtime")
    private Date createTime;

  */
 interface Department {
    id: number
  name: string
  address: string
  leader: string
  active: number
  createTime: string
  
}

// const handleEdit = (index: number, row: Department) => {
//   console.log(index, row)
// }

// const handleEdit = function (index: number, row: Department):void{
//     console.log(index, row)
// }

// const handleEdit =  (index: number, row: Department)=>{
//     console.log(index, row)
// }



// function handleEdit(index: number, row: Department):void{

// }


// const handleEdit = function (index: number, row: Department):void{

// }

// const handleEdit =  (index: number, row: Department):void=>{

// }




const handleDelete = (index: number, row: Department) => {
  console.log(index, row)
}

const tableData: Department[] = [
    {  id: 1111,  name: '内科1',  address: '201', leader: '华佗',  active: 0,  createTime: '2019-01-02 15:08:19'},
    {  id: 2222,  name: '内科2',  address: '201', leader: '华佗',  active: 0,  createTime: '2019-01-02 15:08:19'},
    {  id: 3333,  name: '内科3',  address: '201', leader: '华佗',  active: 0,  createTime: '2019-01-02 15:08:19'},
    {  id: 4444,  name: '内科4',  address: '201', leader: '华佗',  active: 0,  createTime: '2019-01-02 15:08:19'},
    {  id: 5555,  name: '内科5',  address: '201', leader: '华佗',  active: 0,  createTime: '2019-01-02 15:08:19'},
    {  id: 6666,  name: '内科8',  address: '201', leader: '华佗',  active: 0,  createTime: '2019-01-02 15:08:19'},
    {  id: 7777,  name: '内科6',  address: '201', leader: '华佗',  active: 0,  createTime: '2019-01-02 15:08:19'},
    {  id: 8888,  name: '内科7',  address: '201', leader: '华佗',  active: 0,  createTime: '2019-01-02 15:08:19'}
  
]





</script>  
  
<template>  
  



  <el-table :data="tableData" style="width: 100%">
    <el-table-column label="id" width="180" prop="id"> </el-table-column>
    <el-table-column label="name" width="180" prop="name"> </el-table-column>
    <el-table-column label="address" width="180" prop="address"> </el-table-column>
    <el-table-column label="leader" width="180" prop="leader"> </el-table-column>
    <el-table-column label="active" width="180" prop="active"> </el-table-column>
    <el-table-column label="createTime" width="180" prop="createTime"> </el-table-column>
  
  
    <el-table-column label="Operations">
      <template #default="scope">
        <el-button size="small" @click="handleEdit(scope.$index, scope.row)"
          >Edit</el-button
        >
        <el-button
          size="small"
          type="danger"
          @click="handleDelete(scope.$index, scope.row)"
          >Delete</el-button
        >
      </template>
    </el-table-column>
  </el-table>


</template>  
  
<style scoped>  

</style>  